#include "capture.h"
#include "dial.h"
extern thread_pool_t *Tpool;

void *domain_task(void *arg){
    
    dial_arg_t dial_arg = {0};
    dial_result_t *dial_result;

    bzero(&dial_arg, sizeof(dial_arg));
    dial_result = NULL;
    dial_arg.bridge_mode = 0;
    // strcpy(dial_arg.in.dns_arg.dns_svr, "114.114.114.114");
    strcpy(dial_arg.in.dns_arg.dns_svr, "0.0.0.0");
    dial_arg.in.dns_arg.port = 0;
    strcpy(dial_arg.in.dns_arg.domain, "www.qq.com");
    dial_result = (dial_result_t*)dial_dns(&dial_arg);
    dns_result_print(&dial_result->out.dns_result);
    free(dial_result);

    return NULL;
}

int domain_task_init(int argc, char **argv){
    thread_pool_add_task(Tpool, domain_task, NULL);
    return 0;
}